<template>
  <div class="home">
    <input type="text" />
    <button>添加</button>
    <hr />
    <!-- <book :list="list" /> -->
    <!-- 封装整个图书列表 -->

    <table border="1">
      <tr>
        <th>书名</th>
        <th>价格</th>
        <th>操作</th>
      </tr>
      <!-- <tr>
        <td></td>
      </tr> -->
      <bookitem v-for="(item, index) in list" :key="index" :item="item" />
      <!-- 封装每条商品信息 -->
    </table>
  </div>
</template>

<script>
import book from "@/components/Booklist.vue";
import bookitem from "@/components/Bookitem.vue";
export default {
  data() {
    return {
      list: [
        {
          id: 1,
          title: "vuejs从入门到放弃",
          price: 100,
        },
        {
          id: 2,
          title: "猪八戒背媳妇",
          price: 200,
        },
        {
          id: 3,
          title: "三国演义",
          price: 300,
        },
      ],
    };
  },
  components: {
    book,
    bookitem,
  },
};
</script>
